<?php if (!defined('THINK_PATH')) exit();?> <!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
		<script src="/../Thinkphp/Application/Home/View/User/jquery/jquery-3.0.0.js"></script>
		<!--<script src="/../Thinkphp/Application/Home/View/User/jquery/jquery-3.0.0.min.js"></script>-->
		<script type="text/javascript">
			$(function($){
				$("#login").click(function(){
					var url="<?php echo U('User/dologin');?>";
					var data={};
					data['name']=$("#name").val();
					data['pass']=$("#pass").val();
					data['captcha']=$("#captcha").val();				
					var dataType="json";
					$.post(
						url,
						data,
						function(data){						
							if(data.status==1){
								alert(data.info);								
							}
							if(data.status==2){
								alert(data.info);
							}
							if(data.status==0){
								location.href=data.url;	
							}
							
						},
						dataType
						
					);
					return false;
				});
				
			});
		</script>
    </head>
    <body>
        <div>
            <h2>登录页面</h2>
            <form action="<?php echo U('User/dologin');?>" method='post'>
                 姓名：<input type="text" name="name" id="name"/><br/>
                 密码：<input type="password" name="pass" id="pass"/><br/>
                 验证码：<input type="text" name="captcha" id="captcha"/>				 
                 <img src="<?php echo U('home/user/captcha');?>">
                 <a href="">看不清？</a><br/>
                 <input type="submit" value="登录" id="login"/>                
            </form>
        </div>
    </body>
</html>